package vn.sunnet.game.SinhTon.object;

import vn.sunnet.game.SinhTon.global.Assets;

import com.badlogic.gdx.graphics.g2d.Animation;
import com.badlogic.gdx.graphics.g2d.TextureRegion;

public class FireObject {
	private TextureRegion texture;
	private Animation animation1, animation2, animation3;
	private float x = 800, y = 700;
	private float stateTime;
	private boolean isStart;
	
	public FireObject() {
		animation1 = new Animation(0.2f, Assets.trFire1);
		animation2 = new Animation(0.2f, Assets.trFire2);
		animation3 = new Animation(0.2f, Assets.trFire3);	
	}

	public Animation getAnimation() {
		return animation1;
	}

	public float getX() {
		return x;
	}

	public float getY() {
		return y;
	}

	public float getStateTime() {
		return stateTime;
	}

	public void create(float x, float y) {
		this.x = x + 150;
		this.y = y + 259.8f;
	}

	public TextureRegion getTexture() {
		return texture;
	}
	
	public TextureRegion getTexture1() {
		texture = animation3.getKeyFrame(stateTime, true);
		return texture;
	}

	public void update(float time) {
		stateTime += time;
//		x1 += time * 86.6f;
//		y1 += time * 100;
//		if (x1 < 86.6f) {
//			Gdx.app.log(getClass().toString(), "aaaaaaaaaaaaaa");
//			texture = animation.getKeyFrame(stateTime, true);
//			x -= time * 86.6f;
//		} else
			texture = animation2.getKeyFrame(stateTime, true);
//		if (y1 < 100f) {
//			Gdx.app.log(getClass().toString(), "bbbbbbbbb");
//			y -= time * 100;
//		}
	}

	public void reset(float time) {
		stateTime = 0;
	}

	public boolean isStart() {
		return isStart;
	}

	public void setStart(boolean isStart) {
		this.isStart = isStart;
	}
}
